package com.earnings.okhttputils.utils.ui.activity.user;

import android.view.View;

import com.earnings.R;
import com.earnings.okhttputils.utils.UrlConstant.Constant;
import com.earnings.okhttputils.utils.god.GodLeftHandBaseActivity;
import com.earnings.okhttputils.utils.god.Listener.GodOnClickListener;
import com.earnings.okhttputils.utils.ui.activity.common.RecordActivity;
import com.earnings.okhttputils.utils.utils.CommonUtil;


/*
余额
 */
public class UserBalanceActivity extends GodLeftHandBaseActivity implements GodOnClickListener {



    @Override
    protected int onCreateLayoutId() {
        return R.layout.activity_user_balance;
    }

    @Override
    protected void init() {
        setTitle("余额");
        showRightTextView("明细");
      // findViewById( R.id.sumbit).setOnClickListener(this);
        setOnClickListener( this,R.id.sumbit,R.id.withdrawals ,R.id.top_right_tv);
      //  findViewById(R.id.withdrawals).setOnClickListener(this);
    }



    @Override
    protected void onResume() {
        super.onResume();
        setText(R.id.balance,"¥" + CommonUtil.getUser().getUser_money() );
    }

    @Override
    public void OnClickListener(View view) {
        if (view.getId() == R.id.sumbit) {
            skipActivity( UserBalanceRechargeActivity.class );
        } else if (view.getId() == R.id.withdrawals) {
            skipActivity( UserBalanceWithdrawalsActivity.class );

        } else if (view.getId() == R.id.top_right_tv) {
            bundleData.putString( "title" , "余额明细");
            bundleData.putInt( "type" , Constant.RECORD_TYPE_ALL);
            skipActivity( RecordActivity.class );
        }
    }




    /*   @Override
    public void onClick(View v) {

switch (v.getId()){
    case R.id.sumbit:
        skipActivity(UserBalanceRechargeActivity.class);
        break;
    case R.id.withdrawals:
        skipActivity(UserBalanceWithdrawalsActivity.class);
        break;
    case R.id.righttext:
        skipActivity(RecordActivity.class);
        break;
}
    }*/

}
